/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.appschool.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author joaopaulo
 */
@Entity
@Table(name = "horarioAulas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HorarioAulas.findAll", query = "SELECT h FROM HorarioAulas h"),
    @NamedQuery(name = "HorarioAulas.findById", query = "SELECT h FROM HorarioAulas h WHERE h.id = :id"),
    @NamedQuery(name = "HorarioAulas.findBySala", query = "SELECT h FROM HorarioAulas h WHERE h.sala = :sala"),
    @NamedQuery(name = "HorarioAulas.findByDiaSemana", query = "SELECT h FROM HorarioAulas h WHERE h.diaSemana = :diaSemana")})
public class HorarioAulas implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Size(max = 45)
    @Column(name = "sala")
    private String sala;
    @Column(name = "diaSemana")
    private Integer diaSemana;
    @JoinColumn(name = "idDisciplina", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Disciplina idDisciplina;
    @JoinColumn(name = "idProfessor", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Professor idProfessor;

    public HorarioAulas() {
    }

    public HorarioAulas(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSala() {
        return sala;
    }

    public void setSala(String sala) {
        this.sala = sala;
    }

    public Integer getDiaSemana() {
        return diaSemana;
    }

    public void setDiaSemana(Integer diaSemana) {
        this.diaSemana = diaSemana;
    }

    public Disciplina getIdDisciplina() {
        return idDisciplina;
    }

    public void setIdDisciplina(Disciplina idDisciplina) {
        this.idDisciplina = idDisciplina;
    }

    public Professor getIdProfessor() {
        return idProfessor;
    }

    public void setIdProfessor(Professor idProfessor) {
        this.idProfessor = idProfessor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HorarioAulas)) {
            return false;
        }
        HorarioAulas other = (HorarioAulas) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.appschool.model.HorarioAulas[ id=" + id + " ]";
    }
}
